#英文歌曲中的词频统计
lyrics ='Dashing thro the snow, in a one-horse open sleigh.Over the fields we go, laughing all the way.\
Bells on bob-tails ring, making spirits bright,What fun it is to ride and sing a sleighing song tonight.\
Jingle bells, jingle bells, jingle all the way. Oh what fun it is to ride in a one horse open sleigh.\
Jingle bells, jingle bells, jingle all the way. Oh what fun it is to ride in a one horse open sleigh. '
#将歌词中涉及的标点用空格替换
for ch in ",.?!":
    lyrics=lyrics.replace(ch," ")
#利用字典统计词频
words=lyrics.split()
dict1={}
for word in words:
    if word in dict1:
        dict1[word]+=1
    else:
        dict1[word]=1
#对统计结果排序
items=list(dict1.items())
items.sort(key=lambda x:x[1],reverse=True)
#打印控制
for item in items:
    word,count=item
    print("{:<12}{:>5}".format(word,count))